{template header}
<link rel="stylesheet" href="static/calendar/js/calendar.css" />
<script type="text/javascript" charset="utf-8" src="static/calendar/calendar.php"></script>
<style type="text/css">
  .channelDiv{margin-bottom: 10px;}
  .channelList{margin: 10px auto;}
  .channelList li{list-style-type:none;float:left;margin:2px 9px;background-color:#dbeaf9;padding:5px;cursor:pointer;border-radius: 8px;}
  .slasherSettingDiv{clear:both;}
  .bs-docs-example{padding-top: 20px;}
  label{float: left;padding-right: 20px;}
</style>
<script type="text/javascript">
  window.onload=function (){
        var channel = "{$channel}";
        $("#channelList>li").each(function(){
          if($(this).attr("data-value") == channel){
              $(this).css("background-color", "yellow");
            }
        });
  }
</script>
<div class="channelDiv">
  <button class="btn" disabled="disabled">运营渠道：</button>
  <ul id="channelList" class="channelList">
    {loop $channel_list $k $name}
      <li data-value="{$k}"><a href="index.php?c=admin&a=adsSetting&channel={$k}">{$name}</a></li>
    {/loop}
    {if $action != 'insert'}<li><a href="index.php?c=admin&a=adsSetting&type=add">添加一个</a></li>{/if}
  </ul>
</div>
<div class="slasherSettingDiv">
<form enctype="multipart/form-data" method="post" action="index.php?c=admin&a=updateAdsSetting" class="form-horizontal">
<div class="bs-docs-example">
    <table class="table table-striped">
    <tr>
        <td></td>
        <td style="font-weight:bolder;color:red;">重要提醒：<br /><br />
        1、更新开机图片时，需要同时更新 [名称、活动时间、配图] 才会生效<br />2、图片存储大小请不要超过120KB<br />3、变动开始时间后，请重新上传图片</td>
      </tr>
      <tr>
        <td>渠道：</td>
        <td>
          <select name="channel">
            {loop $publishChannel $k $value}
              <option {if $channel == $k}selected="selected"{/if} value="{$k}">{$value}</option>
            {/loop}
          </select>
        </td>
      </tr>
      <tr>
        <td>闪屏图名称：</td>
        <td>
          <input type="text" name="splasher_name" value="{$channelAdsInfo['splasher_name']}" placeholder="请填入闪屏图名称">
          客户端用于识别是否为同一个闪屏, 本参数不能留空
        </td>
      </tr>
      <tr>
        <td>是否显示：</td>
        <td>
          <label for="show_yes"><input name="ads_is_show" id="show_yes" type="radio" value="1" {if $channelAdsInfo['ads_is_show'] =="1"}checked="checked"{/if}>&nbsp;显示</label>
          <label for="show_no"><input name="ads_is_show" id="show_no" type="radio" value="0" {if $channelAdsInfo['ads_is_show'] !="1"}checked="checked"{/if}>&nbsp;不显示</label>
        </td>
      </tr>
      <tr>
        <td>显示次数:</td>
        <td>
            <input type="text" name="show_count" value="{$channelAdsInfo['show_count']}" style="width:400px;">
            0 为不限制显示次数
         </td>
      </tr>
      <tr>
        <td>显示时间:</td>
        <td>
            <input type="text" name="duration_time" value="{$channelAdsInfo['duration_time']}" style="width:400px;">
            单位秒
         </td>
      </tr>
      <tr>
        <td>链接:</td>
        <td>
            <input type="text" name="ads_url" value="{$channelAdsInfo['ads_url']}" style="width:400px;">
            如不需要添加链接，请留空
         </td>
      </tr>
      <tr>
        <td>描述:</td>
        <td><input type="text" name="ads_desc" value="{$channelAdsInfo['ads_desc']}" style="width:400px;"></td>
      </tr>
      <tr>
        <td>渠道活动时间:</td>
        <td>
            开始时间：<input type="text" name="a_start_time" readonly="readonly" id="start_time_id" value="{eval echo date('Y-m-d H:i:s', $channelAdsInfo['a_start_time'])}">
            <input name="start_time_btn" type="button" id="start_time_btn" onclick="return showCalendar('start_time_id', '%Y-%m-%d %H:%M:%S', '24', false, 'start_time_btn');" value="选择" class="button" id="start_time_id"/>
            结束时间：<input type="text" name="a_end_time" readonly="readonly" id="end_time_id" value="{eval echo date('Y-m-d H:i:s', $channelAdsInfo['a_end_time'])}">
            <input name="end_time_btn" type="button" id="end_time_btn" onclick="return showCalendar('end_time_id', '%Y-%m-%d %H:%M:%S', '24', false, 'end_time_btn');" value="选择" class="button" id="end_time_id"/>
         </td>
      </tr>
      
    </table>
</div>
<div class="bs-docs-example">
    <table class="table table-striped">
      <tr>
        <td>配图文字</td>
        <td>
          <textarea name="daily_words" rows="3" style="min-width:75%;">{$channelAdsInfo['daily_words']}</textarea>
          <br />
          若启动图不配文字请将本项留空
        </td>
      </tr>
    </table>
</div>
<div class="bs-docs-example tab-content">
    <ul id="myTab" class="nav nav-tabs">
        <li class="active">
            <a href="#ty" data-toggle="tab">通用尺寸图片</a>
        </li>
        <li><a href="#old" data-toggle="tab">旧版本尺寸图片</a></li>
    </ul>
    <div class="tab-pane fade in active" id="ty">
      <table class="table table-striped">
        <thead>
          <tr>
            <th align="center">手机类型</th>
			      <th align="center">上传图片尺寸 （宽*高）</th>
            <th align="center" style="max-width:60%">图片</th>
            <th align="center">更新(限jgp格式)</th>
          </tr>
        </thead>
        <tbody>
        <tr>
            <td>iPhone 通用</td>
			      <td>640 * 1136</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['apple']}" width="100"></a>
              {else}<img src="{$ads_url['apple']}" width="100">{/if}
            </td>
            <td><input type="file" name="apple"></td>
        </tr>
        <tr>
            <td>安卓 通用</td>
           <td>720 * 1280</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['android']}" width="100"></a>
              {else}<img src="{$ads_url['android']}" width="100">{/if}
            </td>
            <td><input type="file" name="android"></td>
        </tr>
        <tr>
        	<td></td>
            <td>
              <input type="hidden" name="action" value="{$action}">
              <button class="btn" type="submit">更新</button>
              <button class="btn" type="reset">重置</button></td>
        </tr>
        </tbody>
      </table>
      </div>
      <div class="tab-pane fade" id="old" style="clear:both">
      <table class="table table-striped">
        <thead>
          <tr>
            <th align="center">手机类型</th>
            <th align="center">上传图片尺寸 （宽*高）</th>
            <th align="center" style="max-width:60%">图片</th>
            <th align="center">更新(限jgp格式)</th>
          </tr>
        </thead>
        <tbody>
        <tr>
            <td>iPhone 4/4S</td>
            <td>640 * 770</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['apple_4']}" width="100"></a>
              {else}<img src="{$ads_url['apple_4']}" width="100">{/if}
            </td>
            <td><input type="file" name="apple_4"></td>
        </tr>
        <tr>
            <td>iPhone 5/5S</td>
           <td>640 * 946</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['apple_5']}" width="100"></a>
              {else}<img src="{$ads_url['apple_5']}" width="100">{/if}
            </td>
            <td><input type="file" name="apple_5"></td>
        </tr>
        <tr>
            <td>壕6(Iphone6)</td>
            <td>750 * 1144</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['apple_6']}" width="100"></a>
              {else}<img src="{$ads_url['apple_6']}" width="100">{/if}
            </td>
            <td><input type="file" name="apple_6"></td>
        </tr>
        <tr>
            <td>壕6 plus(Iphone6 plus)</td>
            <td>1242 * 1923</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['apple_6P']}" width="100"></a>
              {else}<img src="{$ads_url['apple_6P']}" width="100">{/if}
            </td>
            <td><input type="file" name="apple_6P"></td>
        </tr>
        <tr>
            <td>Android大[三星Note 3,i9152]</td>
           <td>720 * 1066</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['android_l']}" width="100"></a>
              {else}<img src="{$ads_url['android_l']}" width="100">{/if}
            </td>
            <td><input type="file" name="android_l"></td>
        </tr>
        <tr>
            <td>Android中[M1]</td>
            <td>540 * 800</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['android_m']}" width="100"></a>
              {else}<img src="{$ads_url['android_m']}" width="100">{/if}
            </td>
            <td><input type="file" name="android_m"></td>
        </tr>
        <tr>
            <td>Android小[三星W2013]</td>
            <td>480 * 658</td>
            <td>
              {if $channelAdsInfo['ads_url']}<a href="{$channelAdsInfo['ads_url']}"><img src="{$ads_url['android_s']}" width="100"></a>
              {else}<img src="{$ads_url['android_s']}" width="100">{/if}
            </td>
            <td><input type="file" name="android_s"></td>
        </tr>
        <tr>
          <td></td>
            <td>
              <input type="hidden" name="action" value="{$action}">
              <button class="btn" type="submit">更新</button>
              <button class="btn" type="reset">重置</button></td>
        </tr>
        </tbody>
      </table>
      </div>
  </div>
</form>
</div>
{template footer}